<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       * {
            margin: 0;
            padding: 0;
        }

        body {
            height: 3000px;
        }

        header {
            width: 100%;
            height: 60px;
            background: brown;
        }

        nav {
            width: 100%;
            height: 60px;
            background: gray
        }

        main {
            width: 1200px;
            height: 175px;
            margin: 0 auto;
            background: green;
            padding-top: 1px;
        }

        main section {
            width: 627px;
            height: 40px;
            margin: 0 auto;
            margin-top: 62px;
            border-radius: 40px;
            background: white;
        }

        .box {
            width: 550px;
            height: 36px;
            float: left;
            border-top: 3px solid #ff5000;
            border-left: 3px solid #ff5000;
            border-bottom: 3px solid #ff5000;
            border-radius: 36px 0 0 36px;
            position: relative;
            bottom: 1px;
            overflow: hidden;
        }

        section button {
            width: 74px;
            height: 42px;
            border-radius: 0 42px 42px 0;
            background: #ff6d00;
            border: none;
            float: right;
            position: relative;
            bottom: 1px;
            cursor: pointer;
        }

        .box2 {
            height: 36px;
            overflow: hidden;
            width: 472px;
        }

        .box2 input {
            padding: 6px 0;
            text-indent: 10px;
            height: 24px;
            line-height: 24px;
            width: 472px;
            border: none;
            outline: 0;
            background: #FFF;
        }

        .box3 {
            float: right;
            position: relative;
            bottom: 29px;
            right: 21px;
        }
        article{
            width: 100%;
            height: 80px;
            background: greenyellow;
            position: fixed;
            top: -80px;
            /* display: none; */
        }
        .animate {
            transition: all 0.5s ease-in-out;
        }
        article section {
            width: 627px;
            height: 40px;
            margin: 0 auto;
            margin-top: 20px;
            border-radius: 40px;
            background: white;
        }
    </style>
</head>
<body>
    <header></header>
    <nav></nav>
    <main>
        <section id="sec">
            <div class="box">
                <div class="box2">
                    <input type="text" name="" id="">
                </div>
                <div class="box3">
                    <img src="images/xiangji.png" alt="">
                </div>
            </div>
            <button>
                搜索
            </button>
        </section>
    </main>
    <article id="art">
        <section>
            <div class="box">
                <div class="box2">
                    <input type="text" name="" id="">
                </div>
                <div class="box3">
                    <img src="images/xiangji.png" alt="">
                </div>
            </div>
            <button>
                搜索
            </button>
        </section>
    </article>
    <script>
           var art = document.getElementById('art');
        window.onscroll = function(){
            if(scrollY >= 370){
                art.className = "art animate"
                art.style.top = 0 + 'px'

                // art.style.display = "block";
            }
            else{
                art.className = "art animate"
                art.style.top = -80 + 'px'

                 // art.style.display = "none";
            }
        } 
    </script>
</body>
</html>